package com.xm.controller;

import com.xm.annotation.XmAutowired;
import com.xm.annotation.XmController;
import com.xm.annotation.XmRequestMapping;
import com.xm.service.TestService;

import java.util.HashMap;
import java.util.Map;

@XmController
@XmRequestMapping(value = "/test")
public class TestController {

    @XmAutowired
    private TestService testService;

    @XmRequestMapping(value = "/test")
    public String test(){
        System.out.println("请求成功："+testService.randomInt());
        return "test";
    }

    @XmRequestMapping(value = "/test2")
    public Map<String,Object> test2(){
        Map<String,Object> map = new HashMap<>();
        map.put("userName","xm");
        map.put("age","18");
        map.put("gender","男");
        return map;
    }
}
